<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        window.onload=function()
        {
            //ES6 允许按照一定模式从数组和对象中提取值，对变量进行赋值
            //这被成为解构赋值
            //1.数组的解构
            const F4=[1,2,3,4];
            let [a,b,c,d]=F4;
            console.log(a);
            console.log(b);
            console.log(c);
            console.log(d);

            //2.数组的解构
            const Zhao=
            {
                name:"赵本山",
                age:58,
                skill:function()
                {
                    console.log("演小品");
                }
            };

            let{name,age,skill}=Zhao;
            console.log(name);
            console.log(age);
            console.log(skill);
            skill();
        };
    </script>
</head>
<body>
    
</body>
</html>